package com.itheima.demo1;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class Test01 {
    public static void main(String[] args) {
        String str = "91.4 27.23 46.4 38.7 50.2";
        String[] split = str.split(" ");
        BigDecimal sd =  BigDecimal.ZERO;
        for (int i = 0; i < split.length; i++) {
            BigDecimal sd1 = new BigDecimal(split[i]);
            sd = sd1.add(sd);
        }
        BigDecimal sd2 = new BigDecimal(split.length);
        BigDecimal divide = sd.divide(sd2, 2, BigDecimal.ROUND_UP);
        System.out.println(divide);
    }
}
